home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Tele
/
C
/
Comet2.1.3.cpt
/
include
/
task.h
< prev
next >
Wrap
Text File
|
1990-05-11
|
2KB
|
56 lines
/* Copyright 1983 by the Massachusetts Institute of Technology */
/*
Copyright Cornell University 1986. All rights are reserved.
As of 4/10/86:
This source file may have no changes from the M.I.T original
other than this notice; but it has been tested as part of
Cornell's Aztec-C port. See notice.h
*/
/* task.h
4/17/84 - Added tk_sleep().
5/23/84 - Added tk_exit(), guard words and context switch counting.
<John Romkey>
*/
/* 3/16/88 kevin added cticks */
/* This file contains definitions for the IBM PC tasking package. */
typedef char stack; /* type of data in task stacks */
/* relaxed to a char type to simplify block move counting -- kevin */
typedef char event;
typedef struct task /* an IBM PC task - top of its stack */
{
stack *tk_sp; /* task's current stack ptr */
stack *tk_fp; /* task's current frame ptr */
char *tk_name; /* the task's name */
unsigned long tk_size; /* current size of saved stack */
int ev_flg; /* flag set if task is scheduled */
struct task *tk_nxt; /* pointer to next task */
unsigned tk_count; /* number of wakeups */
unsigned *tk_guard; /* pointer to lowest guardword */
unsigned tk_alloc; /* allocated stack size */
stack tk_stack[1]; /* top of task's stack */
} *Task;
typedef struct task task;
extern struct task *tk_cur; /* currently running task */
extern struct task *tk_main; /* the first task */
extern struct task *tk_init (); /* initialize task system */
extern struct task *tk_fork (); /* fork a new task */
extern struct task * tkrun; /* give this task priority in running; used for tcp acking */
extern struct task * tkruncomp; /* return quickly to the process we were executing */
extern unsigned TDEBUG; /* tasking debugging */
extern long tk_wakeups;
#ifndef MACTCP
extern unsigned long cticks; /* current # of ticks elapsed */
#endif